<?php
	/**
	* Change user state : Enable; Disable ; For Manage user in Files Explorer 
	* @author trungdt
	* @since Apr, 2012
	*/

	if (!defined('EXPONENT')) exit('');
	if (exponent_users_isAdmin() || exponent_permissions_check(array("administrate"),$loc))
	{
		$fuser = null;

		if (isset($_POST['id'])) {
			$fuser = $db->selectObject('filemanagermodule_users','id='.intval($_POST['id']));
		} 

		if ($fuser->active == 0)
			$fuser->active=1;
		else
			$fuser->active=0;

		$db->updateObject($fuser,'filemanagermodule_users');
		
		exponent_flow_redirect();
	}
	else {
		echo exponent_http_error(403);
	}

?>